From: Daniel Friesen Date: Fri, 26 Aug 2011 00:01:55 +0000 (+0000) Subject: Followup r93417; Don't use $wgServer in a way that makes invalid Message-IDs. Instead... X-Git-Tag: 1.31.0-rc.0~28059 X-Git-Url: http://git.cyclocoop.org/%22.%24info%5B?a=commitdiff_plain;h=9668ff47055d37c8d1ee477c5fc9442c97cf0259;p=lhc%2Fweb%2Fwiklou.git Followup r93417; Don't use $wgServer in a way that makes invalid Message-IDs. Instead use IDHost if set, otherwise extract the host from $wgServer. Also instead of a static UserMailer prefix use the wiki's id. --- diff --git a/includes/UserMailer.php b/includes/UserMailer.php index 11040b1e59..beac67fff4 100644 --- a/includes/UserMailer.php +++ b/includes/UserMailer.php @@ -127,10 +127,16 @@ class UserMailer { * @return String */ static function makeMsgId() { - global $wgServer; + global $wgSMTP, $wgServer; - $msgid = uniqid( "UserMailer", true ); /* true required for cygwin */ - return "<$msgid@$wgServer>"; + $msgid = uniqid( wfWikiID() . ".", true ); /* true required for cygwin */ + if ( is_array($wgSMTP) && $isset($wgSMTP['IDHost']) && $wgSMTP['IDHost'] ) { + $domain = $wgSMTP['IDHost']; + } else { + $url = wfParseUrl($wgServer); + $domain = $url['host']; + } + return "<$msgid@$domain>"; } /**